package com.xywy.tangandroid.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.xywy.tangandroid.R;
import com.xywy.tangandroid.base.BaseActivity;
import com.xywy.tangandroid.util.DateUtil;

public class BloodDataDetailAct extends BaseActivity {

	private TextView middle_title;
	private RelativeLayout left_img;
	private TextView blood_data;
	private TextView blood_device_name;
	private TextView date;
	private TextView is_shoudong;
	private TextView time_period;

	@Override
	protected void initView(Bundle savedInstanceState) {
		setContentView(R.layout.act_blood_data_detail);
		left_img = (RelativeLayout) findViewById(R.id.left_img);
		middle_title = (TextView) findViewById(R.id.middle_title);
		middle_title.setText(R.string.blood_data_detail_info);

		blood_data = (TextView) findViewById(R.id.blood_data);
		blood_device_name = (TextView) findViewById(R.id.blood_device_name);
		date = (TextView) findViewById(R.id.date);
		is_shoudong = (TextView) findViewById(R.id.is_shoudong);
		time_period = (TextView) findViewById(R.id.time_period);
	}

	@Override
	protected void initListener() {
		left_img.setOnClickListener(this);
	}

	@Override
	protected void initData() {
		String candvalue = getIntent().getStringExtra("candvalue");
		String device_name = getIntent().getStringExtra("device_name");
		String recordtime = getIntent().getStringExtra("recordtime");
		String shou_data = getIntent().getStringExtra("shou_data");
		String period = getIntent().getStringExtra("period");

		blood_data.setText(candvalue);
		blood_device_name.setText(device_name);

		date.setText(DateUtil.getData(recordtime));
		if (shou_data.length() > 0)
			is_shoudong.setText(R.string.is);
		else
			is_shoudong.setText(R.string.not);
		time_period.setText(period);

	}

	@Override
	public void onClick(View v) {
		super.onClick(v);
		switch (v.getId()) {
		case R.id.left_img:
			finish();
			break;

		default:
			break;
		}
	}
}
